﻿using RaytracerLib.MathLib;
using System;

namespace RaytracerLib.Layers
{
    public class NegOperationLayer : UnaryLayer
    {
        public NegOperationLayer(Layer a_childLayer)
            : base(a_childLayer)
        {
        }

        public override ColorFloat GetColor(Vector2 a_uv, Intersection a_intersection)
        {
            return ColorFloat.White - ChildLayer.GetColor(a_uv, a_intersection);
        }

        public override double GetValue(Vector2 a_uv, Intersection a_intersection)
        {
            return -ChildLayer.GetValue(a_uv, a_intersection);
        }

        public override Tangents GetTangents(Vector2 a_uv, Vector2 a_tx, Vector2 a_ty,
            Intersection a_intersection)
        {
            throw new NotImplementedException();
        }
    }
}